#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableSailorModelAudioDao:DaoBase<TableSailorModelAudio>
    {
        public override string GetFileName()
        {
            return "TableSailorModelAudio.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableSailorModelAudio>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableSailorModelAudio model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.Id)) UnityEngine.Debug.LogError("数据表id重复:TableSailorModelAudio->id: " + model.Id);
            #endif
            cachePrimaryInt[model.Id] = model;
        }
        protected override TableSailorModelAudio ParseRowData(string[] rowData)
        {
            TableSailorModelAudio data = new TableSailorModelAudio();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.Id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.ModelId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.AudioType = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.AudioName = rowData[3];
            }
            return data;
        }
    }
}
